package com.ywu.bpmn.form.standard.api;

import com.ywu.bpmn.form.service.dto.YwuFormInstanceConditionDto;
import com.ywu.bpmn.form.service.dto.YwuFormInstanceDto;
import com.ywu.bpmn.form.standard.service.YwuFormInstanceStandardService;
import com.ywu.common.result.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName YwuFormInstanceApi
 * @Description TODO
 * @Author GroundDemo
 * @Date 2025/4/21 0:50
 * @Version 1.0
 **/
@RestController
@RequestMapping("/ywu/bpmn/form/instance")
public class YwuFormInstanceApi {

    @Autowired
    private YwuFormInstanceStandardService service;

    /**
    * @Author GroundDemo
    * @Description 创建表单实例
    * @Date 0:52 2025/4/21
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/create.form.instance.info")
    public CommonResult<Object> createFromInstance(@RequestBody YwuFormInstanceDto dto) {
        return service.createFromInstance(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 修改表单实例
    * @Date 0:53 2025/4/21
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/update.form.instance.info")
    public CommonResult<Object> updateFromInstance(@RequestBody YwuFormInstanceDto dto) {
        return service.updateFromInstance(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 删除表单实例
    * @Date 0:53 2025/4/21
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/delete.form.instance.info")
    public CommonResult<Object> deleteFromInstance(@RequestBody YwuFormInstanceDto dto) {
        return service.deleteFromInstance(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 分页查询表单实例
    * @Date 0:54 2025/4/21
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/form.instance.page.list.info")
    public CommonResult<Object> queryPageList(@RequestBody YwuFormInstanceDto dto) {
        return service.queryPageList(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 查询表单实例条件
    * @Date 9:33 2025/4/21
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/form.instance.condition.query.info")
    public CommonResult<Object> queryInstanceCondition(@RequestBody YwuFormInstanceConditionDto dto) {
        return service.queryInstanceCondition(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 创建表单实例搜索条件
    * @Date 9:33 2025/4/21
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/form.instance.condition.create.info")
    public CommonResult<Object> createInstanceCondition(@RequestBody YwuFormInstanceConditionDto dto) {
        return service.createInstanceCondition(dto);
    }
}
